package com.happy.cat.project.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.happy.cat.common.utils.BeanTools;
import com.happy.cat.framework.aspectj.lang.annotation.Excel;
import com.happy.cat.project.system.domain.vo.UserOrderVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;


/**
 * 用户订单对象 user_order
 * 
 * @author verne
 * @date 2020-08-12
 */
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName(autoResultMap = true )
@ApiModel(value="用户订单对象", description="用户订单对象数据")
public class UserOrder implements Serializable {

private static final long serialVersionUID=1L;


    /** id */
    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Excel(name = "订单编号")
    @ApiModelProperty(value = "订单编号")
    private String code;

    /** 游戏id */
    @Excel(name = "游戏id")
    @ApiModelProperty(value = "游戏id")
    private Long gameId;

    /** 约玩用户id */
    @Excel(name = "约玩用户id")
    @ApiModelProperty(value = "约玩用户id")
    private Long bookingId;

    /** 被约用户id */
    @Excel(name = "被约用户id")
    @ApiModelProperty(value = "被约用户id")
    private Long accompanyId;

    /** 局数 */
    @Excel(name = "局数")
    @ApiModelProperty(value = "局数")
    private Long number;

    /** 评分 */
    @Excel(name = "评分")
    @ApiModelProperty(value = "评分")
    private Long score;

    /** 创建时间 */
    @Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    /** 优惠券id */
    @Excel(name = "优惠券id")
    @ApiModelProperty(value = "优惠券id")
    private Long voucherCardId;

    /** 平台大区id */
    @Excel(name = "平台大区id")
    @ApiModelProperty(value = "平台大区id")
    private Long regionId;

    /** 合计 */
    @Excel(name = "合计")
    @ApiModelProperty(value = "合计")
    private Integer totalPrice;

    /** 差价猫粮 */
    @Excel(name = "差价猫粮")
    @ApiModelProperty(value = "差价猫粮")
    private Long differencePrice;

    /** 实付猫粮 */
    @Excel(name = "实付猫粮")
    @ApiModelProperty(value = "实付猫粮")
    private Long paidPrice;

    /** 状态(1进行中，2已完成，3已取消) */
    @Excel(name = "状态(1进行中，2已完成，3已取消)")
    @ApiModelProperty(value = "状态(1进行中，2已完成，3已取消)")
    private Integer status;

    /** 支付方式 */
    @Excel(name = "支付方式")
    @ApiModelProperty(value = "支付方式")
    private String paymentMethod;

    /** 下单渠道 */
    @Excel(name = "下单渠道")
    @ApiModelProperty(value = "下单渠道")
    private String orderChannel;

    /** 支付时间 */
    @Excel(name = "支付时间" , width = 30, dateFormat = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "支付时间")
    private Date payTime;

    /** 接单时间 */
    @Excel(name = "接单时间" , width = 30, dateFormat = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "接单时间")
    private Date orderTime;

    /** 取消时间 */
    @Excel(name = "取消时间" , width = 30, dateFormat = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "取消时间")
    private Date cancelTime;

    /** 取消时间 */
    @Excel(name = "取消人")
    @ApiModelProperty(value = "取消人")
    private String cancelBy;

    @Excel(name = "取消原因")
    @ApiModelProperty(value = "取消原因")
    private String cancelReason;

    /** 订单收益 */
    @Excel(name = "订单收益")
    @ApiModelProperty(value = "订单收益")
    private BigDecimal orderIncome;

    public UserOrderVo convertToVo(){
        return BeanTools.convert(this, new UserOrderVo());
    }
}
